package com.yuaihen.databinding.bean;

import android.databinding.BaseObservable;
import android.databinding.Bindable;
import android.databinding.ObservableArrayMap;
import android.databinding.ObservableBoolean;

import com.yuaihen.databinding.BR;

/**
 * Created by Yuaihen.
 * on 2018/11/23
 */
public class Employee extends BaseObservable {

    private String firstName;
    private String lastName;
    public ObservableBoolean isFired = new ObservableBoolean();
    public ObservableArrayMap<String, String> user = new ObservableArrayMap<>();

    public Employee(String firstName, String lastName, boolean isFired) {
        this.firstName = firstName;
        this.lastName = lastName;
        this.isFired.set(isFired);
    }


    @Bindable
    public String getFirstName() {
        return firstName == null ? "" : firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
        notifyPropertyChanged(BR.firstName);
    }

    @Bindable
    public String getLastName() {
        return lastName == null ? "" : lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
        notifyPropertyChanged(BR.lastName);
    }


    public void setFired(boolean fired) {
        isFired.set(fired);
    }

}
